package cn.xiaoniu.dmp.helper

import java.util.Properties

import com.typesafe.config.{Config, ConfigFactory}

/**
  * 解析配置文件 application.conf
  * author: sheep.Old 
  * qq: 64341393
  * Created 2018/5/29
  */
object ConfigHelper {


    private lazy val load: Config = ConfigFactory.load()


    /**
      * 解析spark.serializer
      */

    val serializer: String = load.getString("spark.serializer")

    /**
      * 日志所在路径
      */
//    val logPath = load.getString("dmp.log.path")

    /**
      * parquet输出路径
      */
     val driver: String = load.getString("db.default.driver")
     val url: String = load.getString("db.default.url")
     val user: String = load.getString("db.default.user")
     val password: String = load.getString("db.default.password")
     val table: String = load.getString("dmp.mediaType.table")
     val areatable: String = load.getString("dmp.areaditribution.table")

    val props = new Properties()
    props.setProperty("driver",ConfigHelper.driver)
    props.setProperty("user",ConfigHelper.user)
    props.setProperty("password",ConfigHelper.password)
}
